package com.graduate.twentyone.service.Impl;

import com.graduate.twentyone.domain.Cate;
import com.graduate.twentyone.domain.Echarts;
import com.graduate.twentyone.mapper.CateMapper;
import com.graduate.twentyone.service.CateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CateServiceImpl implements CateService {

    @Autowired
    private CateMapper cateMapper;

    @Override
    public List<Cate> queryAll() {
        return cateMapper.queryAll();
    }

    @Override
    public Integer updateById(Cate cate) {
        return cateMapper.updateById(cate);
    }

    @Override
    public Integer deleteById(Integer cate_id) {
        return cateMapper.deleteById(cate_id);
    }


    @Override
    public Integer addOne(String cate_name) {
        return cateMapper.addOne(cate_name);
    }

    @Override
    public void deleteByIdAndFoods(Integer cate_id) {
        cateMapper.deleteByIdAndFoods(cate_id);
    }

    @Override
    public List<Echarts> queryEcharts() {
        return cateMapper.queryEcharts();
    }
}
